class UsersController < ApplicationController
  def index

  	@users = User.all

  end

  def new

  	# redirect_to

  	# @user = User.new(params)

  end

  def create

  	  @user = User.new(user_params)
  	  
  	  respond_to do |format|
  	  	if @user.save
  	  		format.html { redirect_to users_path, notice: 'User successfully added' }
  	  	else
  	  		# render :text => @user.errors
  	  		format.html { render action: 'new' }
  	  	end
  	  end

  end

  def show
  end

  private

  def user_params
  	params.require(:user).permit(:first_name, :last_name, :email_address, :password, :password_confirmation)
  end

end
